package com.exchange.View;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import com.exchange.Controller.ExchangeDataService;
import com.exchange.Controller.MoreClickListener;
import com.exchange.Controller.a;
import com.exchange.Controller.e;
import com.exchange.Controller.f;
import com.exchange.Controller.h;
import com.exchange.Public.ExchangeConstants;
import com.exchange.Public.f;
import com.exchange.Public.h;
import com.exchange.Public.k;
import com.exchange.Public.m;
import com.exchange.View.a.a;
import com.exchange.View.a.b;
import com.exchange.View.a.d;
import com.exchange.a.a;
import com.exchange.a.b.a;
import com.exchange.a.c;
import com.exchange.b.a;
import java.util.List;

public class z
  implements e, t.a
{
  public static int d = 100;
  Context a;
  public View b;
  public View c;
  public int e;
  public int f;
  public ImageView g;
  public t h = null;
  int i;
  public MoreClickListener j = null;
  private ViewGroup k;
  private List<a> l;
  private f m;
  private a n;
  private ExchangeDataService o;

  public z(Context paramContext, ViewGroup paramViewGroup, int paramInt, ExchangeDataService paramExchangeDataService)
  {
    this.a = paramContext;
    this.i = paramInt;
    this.k = paramViewGroup;
    if ((this.i != 0) && (this.i != 1))
      throw new IllegalArgumentException("type parameter must be either type_big_handler_bottom or type_big_handler_top");
    this.o = paramExchangeDataService;
    Y localY = new Y(this);
    this.o.requestDataAsyn(this.a, localY);
  }

  private void a(a parama, View paramView)
  {
    TextView localTextView1 = (TextView)paramView.findViewById(b.l(this.a));
    if (localTextView1 != null)
      localTextView1.setText(parama.g);
    TextView localTextView2 = (TextView)paramView.findViewById(b.n(this.a));
    if (localTextView2 != null)
    {
      if (!(ExchangeConstants.show_size))
        break label262;
      localTextView2.setText(m.a(this.a, parama.n));
    }
    while (true)
    {
      TextView localTextView3 = (TextView)paramView.findViewById(b.q(this.a));
      if (localTextView3 != null)
        localTextView3.setText(parama.a);
      ImageView localImageView = (ImageView)paramView.findViewById(b.r(this.a));
      if (localImageView != null)
        new f(this.a, localImageView, parama.e).start();
      TextView localTextView4 = (TextView)paramView.findViewById(b.t(this.a));
      if (localTextView4 != null)
        localTextView4.setText("开发：" + parama.u);
      TextView localTextView5 = (TextView)paramView.findViewById(b.u(this.a));
      if (localTextView5 != null)
        localTextView5.setText("名称：" + parama.g);
      TextView localTextView6 = (TextView)paramView.findViewById(b.w(this.a));
      if (localTextView6 != null)
        localTextView6.setText(parama.b);
      return;
      label262: localTextView2.setVisibility(8);
    }
  }

  private void c()
  {
    int i1;
    RelativeLayout.LayoutParams localLayoutParams3;
    Button localButton;
    RelativeLayout.LayoutParams localLayoutParams1 = new RelativeLayout.LayoutParams(-1, h.a(55, this.a));
    if (this.i == 0)
    {
      this.c = View.inflate(this.a, a.a(this.a), null);
      this.b = View.inflate(this.a, a.b(this.a), null);
      this.f = 1;
      if (this.f != 0)
        break label583;
      i1 = 10;
      this.h = new t(this.a, this.f, true, this.o, this.i);
      this.h.setId(0);
      RelativeLayout.LayoutParams localLayoutParams2 = new RelativeLayout.LayoutParams(-1, -2);
      localLayoutParams2.addRule(i1);
      this.h.a(this);
      this.h.a(new a(b.a.b, 1F, 1F));
      this.h.c = this.c;
      this.h.d = this.b;
      localLayoutParams3 = new RelativeLayout.LayoutParams(-1, a());
      localLayoutParams3.addRule(i1);
      if (this.f != 0)
        break label589;
      this.h.addView(this.b, localLayoutParams3);
      this.h.addView(this.c, localLayoutParams1);
      this.h.g();
      RelativeLayout localRelativeLayout1 = new RelativeLayout(this.a);
      LinearLayout.LayoutParams localLayoutParams = new LinearLayout.LayoutParams(-1, -2);
      localRelativeLayout1.setBackgroundColor(Color.alpha(0));
      this.k.addView(localRelativeLayout1, localLayoutParams);
      if (ExchangeConstants.blur_switcher)
      {
        RelativeLayout localRelativeLayout2 = a(localRelativeLayout1);
        this.h.i = localRelativeLayout2;
      }
      localRelativeLayout1.addView(this.h, localLayoutParams2);
      k.b(this.h);
      ((Button)this.b.findViewById(b.e(this.a))).setOnClickListener(new V(this));
      localButton = (Button)this.b.findViewById(b.f(this.a));
      if ((this.l == null) || (this.l.size() != 1))
        break label617;
      localButton.setVisibility(8);
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            do
            {
              ((Button)this.b.findViewById(b.h(this.a))).setOnClickListener(new aa(this));
              this.g = ((ImageView)this.c.findViewById(b.i(this.a)));
              this.h.d.setVisibility(8);
              this.n = this.m.d();
              a(this.n, this.h);
              new a(0, this.a, this.n, this.i, 1, 0, this.o.displayStyle).start();
              new h(this).start();
              return;
            }
            while (this.i != 1);
            this.c = View.inflate(this.a, a.c(this.a), null);
            this.b = View.inflate(this.a, a.d(this.a), null);
            this.f = 0;
          }
          label583: i1 = 12;
        }
        label589: this.h.addView(this.c, localLayoutParams1);
        this.h.addView(this.b, localLayoutParams3);
      }
      label617: localButton.setOnClickListener(new ac(this));
    }
  }

  int a()
  {
    int i1 = 270;
    if (!(h.d(this.a)))
      i1 -= 100;
    return h.a(i1, this.a);
  }

  public RelativeLayout a(ViewGroup paramViewGroup)
  {
    RelativeLayout localRelativeLayout = new RelativeLayout(this.a);
    localRelativeLayout.setId(d);
    localRelativeLayout.setVisibility(8);
    localRelativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
    localRelativeLayout.setBackgroundColor(Color.argb(200, 0, 0, 0));
    paramViewGroup.addView(localRelativeLayout);
    return localRelativeLayout;
  }

  public void a(t paramt)
  {
    if (this.f == 1)
    {
      paramt.a(new a(b.a.b, 1F, 1F));
      if (this.g != null)
        this.g.setImageResource(d.d(this.a));
    }
    while (true)
    {
      do
      {
        paramt.c.setVisibility(0);
        return;
        paramt.a(new c(b.a.b));
      }
      while (this.g == null);
      this.g.setImageResource(d.e(this.a));
    }
  }

  public void a(t paramt, View paramView)
  {
    if (this.f == 1)
    {
      paramt.a(new c(b.a.b));
      if (this.g != null)
        this.g.setImageResource(d.f(this.a));
    }
    while (true)
    {
      do
      {
        paramt.c.setVisibility(0);
        paramt.f();
        new a(2, this.a, this.n, this.i, 1, 0, this.o.displayStyle).start();
        return;
        paramt.a(new a(b.a.b, 1F, 1F));
      }
      while (this.g == null);
      this.g.setImageResource(d.g(this.a));
    }
  }

  public void b()
  {
    this.n = this.m.d();
    a(this.n, this.h);
    new h(this).start();
  }
}